package com.devplatform.mapper.points;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.devplatform.pojo.points.UserPoints;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

/**
 * @author 86156
 * @description 针对表【user_points】的数据库操作Mapper
 * @createDate 2025-09-28 10:03:14
 * @Entity com.devplatform.pojo.UserPoints
 */
public interface UserPointsMapper extends BaseMapper<UserPoints> {
    @Select("select * from user_points where user_id = #{userId}")
    UserPoints selectByUserId(@Param("userId") Long userId);

    @MapKey("userId")
    Map<String, Object> selectUserPointsInfo(@Param("userId") Long userId);

    int incrementPoints(@Param("userId") Long userId, @Param("points") Integer points);
}




